package com.seguriapp.dao;

import static org.hibernate.criterion.Restrictions.eq;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.seguriapp.base.GenericDaoImpl;
import com.seguriapp.entities.MediaContent;

/**
 * Data access object for {@link MediaContent} entities using Hibernate.
 * 
 * @author Tania Gonzales (taniadgv@gmail.com)
 */
@Repository
public class MediaContentDaoImpl extends GenericDaoImpl<MediaContent> implements MediaContentDao {

  public MediaContentDaoImpl() {
    super(MediaContent.class);
  }

  @SuppressWarnings("unchecked")
  public List<MediaContent> getComplaintMediaContentList(final Long complaintId) {
    return getSession().createCriteria(MediaContent.class).add(eq("complaint.id", complaintId)).list();
  }

}
